package com.oazon.common.util;

import com.moco.launcher.activity.ShutDownActivity;
import com.moco.launcher.link.LinkManager;
import com.oazon.moco.link.core.LinkEventController;
import com.oazon.moco.link.core.LinkSDK;
import com.oazon.system.bean.SystemState;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.KeyEvent;

/**
 * 
 * @author weichengke
 *
 */

public class PowerKeyUtil {
	private Context context = null;
	private int keyDownCount = 0;
	private String TAG = "PowerKeyUtil";
	public PowerKeyUtil(Context context){
		this.context = context;
	}
	//change by vincent 150610
	public void SetSysNomalOrProtect(int keyCode, KeyEvent event){
		if (LinkManager.getInstance().getSaveSystemState() == SystemState.NORMAL) {
			LinkManager.getInstance().setScreenProtect();
		} else {
			LinkManager.getInstance().setNormal();
		}}
	public void askForPowrOff(int keyCode, KeyEvent event){

		Intent intent = new Intent(context, ShutDownActivity.class);
		context.startActivity(intent);
		LinkSDK.getInstance().hasAction(LinkEventController.uiSource);
		}
}
